<template>
  <div class="layout">
    <div v-if="policy" id="policyDiv">
      <div style="display: flex; justify-content: space-between">
        <Breadcrumb class="breadcrumb" :crumbs="crumbs"></Breadcrumb>
      </div>
      <div class="policyNameDiv">
        <span class="policyName">{{ policy.policy.name }}</span>
        <div style="width:48px">
          <PublicImage
            :src="formatRedemptionStatusLabel(policy.policy.infoStatus).iconUrl"
            v-if="policy.policy.infoStatus != ''"
          >
          </PublicImage>
          <PublicImage
            :src="require('../../assets/image/policy/going.png')"
            v-if="policy.policy.infoStatus == ''"
          >
          </PublicImage>
        </div>
      </div>
      <div class="policyMsg">

        <span>{{ "阅读浏览：" + policy.policy.pv + "次" }}</span>
      </div>
      <div class="policyMsgTable">
        <div class="policyMsgRow">
          <div class="policyMsgCellTitle">政策文号</div>
          <div class="policyMsgCell">{{ isEmptyStr(policy.policy.no) ? "-" : policy.policy.no }}</div>
          <div class="policyMsgCellTitle">政策类型</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.typeName) ? "-" : policy.policy.typeName }}</div>
        </div>
        <div class="policyMsgRow">
          <div class="policyMsgCellTitle">发文部门</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.publishUnit) ? "-" : policy.policy.publishUnit }}</div>
          <div class="policyMsgCellTitle">发文日期</div>
          <div class="policyMsgCell">{{ policy.policy.releaseTime }}</div>
        </div>
        <div class="policyMsgRow">
          <div class="policyMsgCellTitle">责任部门</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.responsibleDeptName) ? "-" : policy.policy.responsibleDeptName }}</div>
          <div class="policyMsgCellTitle">政策级别</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.levelName) ? "-" : policy.policy.levelName }}</div>
        </div>
        <div class="policyMsgRow">
          <div class="policyMsgCellTitle">政策辐射区域</div>
          <div class="policyMsgCell">
            {{ policy.policy.radiationArea }}
          </div>
          <div class="policyMsgCellTitle">政策辐射行业</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.industryTypeName) ? "-" : policy.policy.industryTypeName }}</div>
        </div>
        <div class="policyMsgRow">
          <div class="policyMsgCellTitle">申报日期</div>
          <div
            class="policyMsgCell"
          >{{ policy.policy.beginDate + " 至 " + policy.policy.closingDate }}</div>
          <div class="policyMsgCellTitle">兑现日期</div>
          <div
            class="policyMsgCell"
          >{{ policy.policy.acceptBeginDate + " 至 " + policy.policy.acceptEndDate }}</div>
        </div>
        <div class="policyMsgRow" style="border-bottom: 0">
          <div class="policyMsgCellTitle">联系人</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.contacts) ? "-" : policy.policy.contacts }}</div>
          <div class="policyMsgCellTitle">联系电话</div>
          <div
            class="policyMsgCell"
          >{{ isEmptyStr(policy.policy.contactNumber) ? "-" : policy.policy.contactNumber }}</div>
        </div>
      </div>
      <!-- 按钮 -->
      <div class="policyBtnDiv">
        <span class="policyApproachEnd">{{ policy.policy.approachEnd == 1 ? '即将到期' : '' }}</span>
        <Buttons :buttons="buttons_send" @sendPolicy="sendPolicy" @none="''"></Buttons>
        <!-- <div
          class="policySendBtn"
          :style="
            'color :' +
            formatBtn(policy.policy).color +
            '; background-color :' +
            formatBtn(policy.policy).bgColor
          "
          @click="sendPolicy()"
          v-if="policy.policy.applyStatus != 2"
        >立即申报</div>
        <div
          class="policyCantSendBtn"
          :style="
            'color :' +
            formatBtn(policy.policy).color +
            '; background-color :' +
            formatBtn(policy.policy).bgColor
          "
          v-if="policy.policy.applyStatus == 2"
        >已申报</div> -->
      </div>
      <!-- tab切换 -->
      <div style="display: flex; justify-content: center">
        <div id="selectTypeDiv">
          <div
            :class="selectTypeIndex == 0 ? 'selectType btn' : 'btn'"
            @click="selectTypeIndex = 0"
          >政策内容</div>
          <div
            :class="selectTypeIndex == 1 ? 'selectType btn' : 'btn'"
            @click="selectTypeIndex = 1"
          >申报指南</div>
          <div
            :class="selectTypeIndex == 4 ? 'selectType btn' : 'btn'"
            @click="selectTypeIndex = 4"
          >政策解读</div>
          <div
            :class="selectTypeIndex == 2 ? 'selectType btn' : 'btn'"
            v-show="entry != 1 && koreanIsSb"
            @click="selectTypeIndex = 2"
          >兑现结果公示</div>

          <div
            :class="selectTypeIndex == 3 ? 'selectType btn' : 'btn'"
            v-show="
              entry == 1 && policy.applyRedemptionInfo.applyStatus != null
            "
            @click="selectTypeIndex = 3"
          >兑现结果公示</div>
        </div>
      </div>
      <!--政策解读-->
      <div class="policyDetailsDiv" v-show="selectTypeIndex == 4">
        <div class="policyDetailDiv" v-if="policy.explain != null && policy.explain.length != 0">
          <!-- <div class="policyTitleDiv">| 相关政策解读</div> -->
          <div v-for="(item, i) in policy.explain" class="policyExplain" :key="i">
            <div class="policyExplainTitle">{{ item.title }}</div>
            <!-- {{ item.content }} -->
            <div class="policyExplainContent" v-html="item.content"></div>
            <div class="policyExplainMsg">
              <span>{{ "解读日期：" + item.createTime.substr(0, 10).replaceAll("-", "/") }}</span>
              <span v-if="item.department">{{ "解读来源：" + item.department }}</span>
              <span v-else>{{ "解读来源：" + '---' }}</span>
            </div>
          </div>
        </div>
        <div v-else>
          <div class="empty">
            <img src="@/assets/image/empty.png" />
            <p>暂无内容</p>
          </div>
        </div>
      </div>
      <!--政策详情-->
      <div class="policyDetailsDiv" v-show="selectTypeIndex == 0">
        <div class="policyDetailDiv" v-if="!isEmptyStr(policy.policy.description)">
          <!-- <div class="policyTitleDiv">| 政策详情</div> -->
          <!-- <div class="policyDescription">{{ policy.policy.description.replace(/<[^<>]+>/g, "") }}</div> -->
          <div class="policyDescription">
            <pre v-html="policy.policy.description"></pre>
          </div>
          <div class="policyDescriptiona" v-show="policy.policy.originalLink" >
            <!-- <span>{{'原文链接: ' + policy.policy.originalLink }}</span> -->
            <div style="position: absolute;">原文链接：</div>
            <div style="line-height: 24px;text-indent: 5em;">{{ policy.policy.originalLink }}</div>
          </div>
        </div>
      </div>
      <!--申报指南-->
      <div class="policyDetailsDiv" v-show="selectTypeIndex == 1">
        <!-- <div class="policyDetailDiv">
          <div class="policyExplainTitle" style="margin-bottom: 20px">
            {{ "申报项目名称：" + policy.policy.name }}
          </div>
          <div class="policyExplainMsg">
            <span>{{ "申报开始时间：" + policy.policy.beginDate }}</span>
            <span style="margin-left: 50px">{{
              "申报结束时间：" + policy.policy.closingDate
            }}</span>
          </div>
          <div class="policyExplainMsg">
            <span>{{ "受理开始时间：" + policy.policy.acceptBeginDate }}</span>
            <span style="margin-left: 50px">{{
              "受理结束时间：" + policy.policy.acceptEndDate
            }}</span>
          </div>
        </div>-->
        <div class="policyDetailDiv" v-if="!isEmptyStr(policy.policy.requirement)">
          <div class="policyTitleDiv">| 申报条件</div>
          <div class="policyDescription">
            {{ policy.policy.requirement.replace(/<[^<>]+>/g, "") }}
            <!-- <div v-for="(item,index) in requirementList" :key="index">
              <span>{{index + 1 + "、"}}</span>
              <span>{{item}}</span>
            </div>-->
          </div>
        </div>
        <div class="policyDetailDiv" v-if="!isEmptyStr(policy.policy.redemptionForm)">
          <div class="policyTitleDiv">| 兑现额度/内容</div>
          <!-- policy.policy.redemptionContent.replace(/<[^<>]+>/g, "") -->
          <div class="policyDescription">{{ cashLimit(policy.policy.redemptionForm) }}</div>
        </div>
        <div class="policyDetailDiv" v-if="!isEmptyStr(policy.policy.companyProcedure)">
          <div class="policyTitleDiv">| 企业办事流程</div>

          <div class="policyDescription">
            <!-- {{ policy.policy.companyProcedure.replace(/<[^<>]+>/g, "") }} -->
            <div v-for="(item,index) in companyProcedureList" :key="index">
              <!-- <span>{{index + 1 + "、"}}</span> -->
              <span>{{ item }}</span>
            </div>
          </div>
        </div>
        <div class="policyDetailDiv" v-if="!isEmptyStr(policy.policy.governmentProcedure)">
          <div class="policyTitleDiv">| 政府内部流转流程</div>
          <div class="policyDescription">
            <div v-for="(item,index) in governmentProcedureList" :key="index">
              <!-- <span>{{index + 1 + "、"}}</span> -->
              <span>{{ item }}</span>
            </div>
          </div>

          <!-- <div
            class="policyDescription"
          >{{ policy.policy.governmentProcedure.replace(/<[^<>]+>/g, "") }}</div>-->
        </div>
        <!-- v-if="policy.accessories != null && policy.accessories.length > 0" -->
        <div class="policyDetailDiv">
          <div class="policyTitleDiv">| 申报材料</div>
          <template v-if="policy.accessories != null && policy.accessories.length > 0">
            <div
              v-for="(accessorie, index) in policy.accessories"
              :key="index"
              class="accessorieDiv"
            >
              <span>{{ index + 1 + "、" }}</span>
              <span
                class="accessorieFileName"
                @click="openUrl(accessorie.filePath,accessorie.fileName)"
              >{{ accessorie.fileName }}</span>
              <!-- <a
                class="accessorieFileName"
                :href="accessorie.filePath"
                download="测试"
              >{{ accessorie.fileName }}</a> -->
            </div>
          </template>
        </div>
      </div>
      <!--兑现结果公示-->
      <!-- <div>{{selectTypeIndex}}{{entry}}</div> -->
      <div class="policyDetailsDiv" v-if="selectTypeIndex == 2 && entry != 1">
        <div class="policyDetailDiv">
          <div class="policyTitleDiv">| 兑现结果公示</div>
          <div class="policyDescription">
            <span>{{ "《" + policy.policy.name + "》共收到" }}</span>
            <span class="showingNum">{{ policy.applyCompany }}</span>
            <span>家企业申报申请，其中符合申报条件的企业</span>
            <span class="showingNum">{{ policy.applyCompanyFinish }}</span>
            <span>家，已兑现企业</span>
            <span class="showingNum">{{ policy.redemptionCompanyFinish }}</span>
            <span>家，未兑现企业</span>
            <span class="showingNum">{{ policy.redemptionCompany }}</span>
            <span>家</span>
          </div>
          <!-- <div
            class="policyDescription"
            v-if="policy.applyCompany == 0 || policy.applyCompany == null"
          >
            <span>暂无兑现结果公示</span>
          </div>-->
        </div>
        <!-- 兑现企业列表 -->
        <!-- <div
          class="policyDetailDiv"
          v-if="policy.applyList != null && policy.applyList.length > 0">
          <div class="policyTitleDiv">| 企业申报兑现情况</div>
          <div style="margin: 30px 10px">
            <ApplyList
              :applyList="policy.applyList"
              :no="policy.policy.no"></ApplyList>
          </div>
        </div>-->
      </div>
      <!--兑现结果公示-->
      <div
        class="policyDetailsDiv"
        v-show="
          selectTypeIndex == 3 &&
          entry == 1 &&
          //原少了审核不通过时的判断,10-13补
          (policy.applyRedemptionInfo.applyStatus == 4 || policy.applyRedemptionInfo.redemptionStatus >= 5 || policy.applyRedemptionInfo.redemptionStatus <= 7) &&
          policy.policy.infoStatus == 7
        "
      >
        <div class="policyDetailDiv">
          <div class="policyTitleDiv">| 兑现结果公示</div>
          <div class="policyDescription">
            <span>{{ "《" + policy.policy.name + "》共收到" }}</span>
            <span class="showingNum">{{ policy.applyCompany }}</span>
            <span>家企业申报申请，其中符合申报条件的企业</span>
            <span class="showingNum">{{ policy.applyCompanyFinish }}</span>
            <span>家，已兑现企业</span>
            <span class="showingNum">{{ policy.redemptionCompanyFinish }}</span>
            <span>家，未兑现企业</span>
            <span class="showingNum">{{ policy.redemptionCompany }}</span>
            <span>家</span>
          </div>
        </div>
      </div>
      <div
        class="policyDetailsDiv"
        v-show="
          selectTypeIndex == 3 &&
          entry == 1 &&
          policy.applyRedemptionInfo.applyStatus != null &&
          policy.policy.infoStatus != 7
        "
      >
        <div class="policyDetailDiv">
          <div class="policyTitleDiv">| 申报结果</div>
          <div class="policyDescription">
            <div>
              {{
              "申报状态：" +
              formatApplyStatus(policy.applyRedemptionInfo.applyStatus).label
              }}
              <!-- formatApplyStatus(policy.policy.infoStatus).label -->
            </div>
            <div
              v-if="
                policy.applyRedemptionInfo.applyStatus == 4 &&
                !isEmptyStr(policy.applyRedemptionInfo.applyCloseReason)
              "
            >{{ "申报不成功理由：" + policy.applyRedemptionInfo.applyCloseReason }}</div>
          </div>
        </div>
        <div
          class="policyDetailDiv"
          v-if="
            policy.applyRedemptionInfo.applyStatus == 3 &&
            policy.applyRedemptionInfo.redemptionStatus != null &&
            policy.applyRedemptionInfo.redemptionStatus < 5
          "
        >
          <div class="policyTitleDiv">| 兑现结果</div>
          <div class="policyDescription">
            <div>{{ "兑现状态：" + formatRedemptionStatus(policy.applyRedemptionInfo.redemptionStatus).label }}</div>
            <div
              v-if="policy.applyRedemptionInfo.redemptionForm == 1"
            >{{ "兑现金额：" + formatPrice(policy.applyRedemptionInfo.redemptionAmount) + "元" }}</div>
            <div
              v-if="
                policy.applyRedemptionInfo.redemptionForm == 2 ||
                policy.applyRedemptionInfo.redemptionForm == 3
              "
            >{{ "兑现内容：" + policy.applyRedemptionInfo.redemptionContent }}</div>
            <div
              v-if="
                policy.applyRedemptionInfo.redemptionStatus == 4 &&
                !isEmptyStr(policy.applyRedemptionInfo.redemptionCloseReason)
              "
            >{{ "兑现不成功理由：" + policy.applyRedemptionInfo.redemptionCloseReason }}</div>
          </div>
        </div>
      </div>
      <div class="btn-bottom">
        <Buttons :buttons="buttons" @goBack="goBack"></Buttons>
      </div>
    </div>
  </div>
</template>

<script>
import ApplyList from './components/applyList'
import Breadcrumb from '@/components/breadcrumb'

import config from '@/utils/config.js'
import common from '@/utils/common.js'
import { getPolicyDetail } from "@/common/api/policy.js";
import {
  isLogin,
  setLastUrl,
  formatLabel,
  isEmptyStr,
  formatSendBtn,
  formatPrice,
} from '@/utils/util.js'
import { request } from '../../utils/request'

export default {
  name: '',
  components: { ApplyList, Breadcrumb },
  computed:{
    buttons_send(){
      if(this.policy.policy.applyStatus != 2){
        return [{ text: "立即申报", type: "success", size: "l", method: "sendPolicy" }]
      }else{
        return [{ text: "已申报", type: "weakSuccess", size: "l", method: "none" }]
      }
    }
  },
  data() {
    return {
      buttons: [{ text: "返回", type: "normal", size: "l", method: "goBack" }],
      policyId: null,
      policy: null,
      selectTypeIndex: 0, //标签页选择的值
      crumbs: [
        { label: '政策服务', value: 'policy' },
        { label: '政策清单', value: 'policyList' },
        { label: '政策详情', value: 'policyDetail', choose: true },
      ],
      entry: 0,
      koreanIsSb: false,
      applyStatus: null,
      governmentProcedureList: [], //政府内部流转流程
      companyProcedureList: [], //企业办事流程
      requirementList: [], //申报条件
    }
  },
  methods: {
    /**
     * 返回上一页
     */
    goBack: function () {
      let ns = this
      ns.$router.back()
    },
    /**
     * 判断字符串是否为空
     */
    isEmptyStr: function (str) {
      return isEmptyStr(str)
    },
    /**
     * 格式化显示政策状态
     * @param status 政策状态
     * @return {string|*} 政策状态字符串
     */
    formatStatus: function (status) {
      if (status == null || status == undefined) {
        return { label: '' }
      }
      for (let i = 0; i < common.applyStatus.length; i++) {
        if (common.applyStatus[i].value == status) {
          return common.applyStatus[i]
        }
      }
      return { label: '' }
    },
    /**
     * 格式化显示申报状态
     * @param status 申报状态
     * @return {string|*} 申报状态字符串
     */
    formatApplyStatus: function (status) {
      console.log('policy.applyRedemptionInfo.applyStatus', this.policy)
      console.log('status', status)
      if (status == null || status == undefined) {
        return { label: '' }
      }
      for (let i = 0; i < common.applyStatus.length; i++) {
          console.log('status2', status)
        if (common.applyStatus[i].value == status) {
          // console.log('common.applyStatus[i]', common.applyStatus[i])
          if (
            common.applyStatus[i].label == '已通过' ||
            common.applyStatus[i].label == '待兑现' ||
            common.applyStatus[i].label == '已兑现'
          ) {
            common.applyStatus[i].label = '审核通过'
            return common.applyStatus[i]
          }
          return common.applyStatus[i]
        }
      }
      return { label: '' }
    },
    /**
     * 格式化显示申报状态
     * @param status 申报状态
     * @return {string|*} 申报状态字符串
     */
    formatRedemptionStatus: function (status) {
      if (status == null || status == undefined) {
        return { label: '' }
      }
      for (let i = 0; i < common.redemptionStatus.length; i++) {
        if (common.redemptionStatus[i].value == status) {
          return common.redemptionStatus[i]
        }
      }
      return { label: '' }
    },
    /**
     * 格式化显示申报标签状态
     * @param status 申报标签状态
     * @return {string|*} 申报标签状态字符串
     */
    formatRedemptionStatusLabel: function (status) {
      for (let i = 0; i < common.redemptionStatusLabel.length; i++) {
        if (common.redemptionStatusLabel[i].value == status) {
          // console.log(common.redemptionStatusLabel[i], '1234')
          return common.redemptionStatusLabel[i]
        }
      }
      return { label: '' }
    },
    /**
     * 格式化标签
     * @param label 标签名
     * @return {string|*} 标签名对象
     */
    formatLabel: function (label) {
      return formatLabel(label)
    },
    /**
     * 获取政策信息
     */
    async getPolicy() {
      let ns = this
      let res = await getPolicyDetail(ns.policyId)
      if (res.code == 200) {
        ns.policy = res.data

        if (
          this.selectTypeIndex == 2 &&
          this.entry == 1 &&
          this.policy.applyRedemptionInfo.applyStatus != null
        ) {
          this.selectTypeIndex = 3
        }
        this.governmentProcedureList =
          ns.policy.policy.governmentProcedure.split('\n') // 政府内部流转流程

        this.companyProcedureList =
          ns.policy.policy.companyProcedure.split('\n') // 企业办事流程
        this.requirementList = ns.policy.policy.requirement.split('\n') //申报条件
        // var
        // ns.selectTypeIndex = 0
        if (ns.selectTypeIndex <= 0) {
          ns.selectTypeIndex = 0
        }
        ns.applyStatus = ns.policy.applyRedemptionInfo.applyStatus
        if (
          ns.applyStatus != 0 ||
          ns.applyStatus != null ||
          ns.applyStatus != undefined
        ) {
          ns.entry = 1
          // console.log(ns.entry, '123')
        }
        if (ns.policy.policy.applyStatus != 2) {
          ns.entry = 0
        }
        // console.log(ns.applyStatus, 'this.policy')
      } else {
        this.$confirm(res.msg, {
          showCancelButton: false,
          confirmButtonText: '返回',
        }).then((_) => {
          ns.$router.go(-1)
        })
      }
      console.log("koreanIsSb",ns.koreanIsSb);
      console.log("entry",ns.entry)
    },
    /**
     * 兑现额度/内容
     */
    cashLimit(item) {
      var Cash = ''
      if (item == '1') {
        Cash = this.policy.policy.redemptionAmount + '元'
        // console.log(Cash)
      } else if (item == '2') {
        Cash = this.policy.policy.redemptionContent
      } else if (item == '3') {
        Cash = this.policy.policy.redemptionContent
      }
      return Cash
    },
    /**
     * 打开新页面
     * @param url 要打开的新页面地址
     */
    openUrl: function (url,filename) {
      let ns = this;
      // console.log(name)
      // window.open(url,filename)
      request(ns, `${config.api.download}?fileUrl=${url}&fileName=${filename}`,{},"GET",{},false,'',"blob" )
        .then(res => {
            let blob = new Blob([res], { type: "application/x-xls" });　　//res--后台返回的文件流
      　　　 let link = document.createElement("a");
            link.href = window.URL.createObjectURL(blob);
            link.download = filename;
            link.click();
        })

    },
    /**
     * 立即申报事件
     */
    sendPolicy: function () {
      let ns = this
      if (!formatSendBtn(ns.policy.policy).canIn) {
        return
      }
      this.$CheckRole("申请政策", () => {
        // if (!isLogin()) {
        //   setLastUrl(window.location.href)
        //   ns.$router.push({ path: 'login' })
        // } else {
          ns.$router.push({
            path: '/policy/policyDetail/policySend',
            query: { id: ns.policy.policy.id }
          })
        // }
      })
    },
    /**
     * 格式化显示按钮颜色
     */
    formatBtn: function (policy) {
      return formatSendBtn(policy)
    },
    /**
     * 格式化显示金额
     * @param price 要格式化的金额
     * @return {String} 格式化后的金额
     */
    formatPrice: function (price) {
      return formatPrice(price)
    },
  },
  mounted() {
    // let ns = this
    // ns.policyId = ns.$route.query.id
    // ns.entry = ns.$route.query.entry || ns.$options.data().entry
    // if(ns.$route.query.selectTypeIndex != undefined) {
    // 	ns.selectTypeIndex = ns.$route.query.selectTypeIndex
    // }
    // ns.getPolicy()
    let ns = this
    ns.policyId = ns.$route.query.id
    var name = ns.$route.query.item
    if (name == 1) {
      this.crumbs = [
        { label: '政策服务', value: 'policy' },
        { label: '政策兑现', value: 'policyCash' },
        { label: '政策详情', value: 'policyDetail', choose: true },
      ]
    } else {
      this.crumbs = [
        { label: '政策服务', value: 'policy' },
        { label: '政策清单', value: 'policyList' },
        { label: '政策详情', value: 'policyDetail', choose: true },
      ]
    }
    ns.entry = ns.$route.query.entry || ns.$options.data().entry
    // console.log(this.entry, 'this.entry')
    if (ns.$route.query.selectTypeIndex != undefined) {
      ns.selectTypeIndex = ns.$route.query.selectTypeIndex
    } else {
      this.selectTypeIndex = 0
    }
    if (!isLogin()) {
      this.koreanIsSb = false
      this.entry = 0
    } else {
      this.koreanIsSb = true
      this.entry = 1
    }
    // if (ns.selectTypeIndex == 2 && this.entry == 1) {
    //   this.selectTypeIndex = 2
    // } else if (ns.selectTypeIndex == 2 && this.entry != 1) {
    //   this.selectTypeIndex = 2
    // } else {
    //   this.selectTypeIndex = 3
    // }
    // console.log(this.entry)
    // console.log('ns.selectTypeIndex', ns.selectTypeIndex)
    ns.getPolicy()
  },
  // activated() {
  //   let ns = this
  //   ns.policyId = ns.$route.query.id
  //   this.selectTypeIndex = 0
  //   var name = ns.$route.query.item
  //   if (name == 1) {
  //     this.crumbs = [
  //       { label: '政策服务', value: 'policy' },
  //       { label: '政策兑现', value: 'policyCash' },
  //       { label: '政策详情', value: 'policyDetail', choose: true },
  //     ]
  //   } else {
  //     this.crumbs = [
  //       { label: '政策服务', value: 'policy' },
  //       { label: '政策清单', value: 'policyList' },
  //       { label: '政策详情', value: 'policyDetail', choose: true },
  //     ]
  //   }
  //   ns.entry = ns.$route.query.entry || ns.$options.data().entry
  //   // console.log(this.entry, 'this.entry')
  //   if (ns.$route.query.selectTypeIndex != undefined) {
  //     ns.selectTypeIndex = ns.$route.query.selectTypeIndex
  //   }
  //   if (!isLogin()) {
  //     this.koreanIsSb = false
  //     this.entry = 0
  //   } else {
  //     this.koreanIsSb = true
  //     this.entry = 1
  //   }
  //   console.log(this.entry)
  //   // console.log('ns.selectTypeIndex', ns.selectTypeIndex)
  //   ns.getPolicy()
  // },
  // created() {
  //   if (!isLogin()) {

  //   } else {

  //   }

  // },
}
</script>

<style scoped>
.policyApproachEnd {
  color: #d00000;
  font-size: 15px;
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  margin-right: 10px;
}
.breadcrumb {
  width: 1200px;
  margin-bottom: 30px;
}

#policyDiv {
  text-align: left;
  width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

#policyDiv .policyType {
  padding: 8px 12px;
  /* background-color: #f7f1eb;
		color: #f09450; */
  background: #f4fbff;
  color: #5f89e6;
  display: inline-block;
  font-size: 12px;
}

#policyDiv .policyNameDiv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}
#policyDiv .policyNameDiv img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

#policyDiv .policyNameDiv .policyName {
  font-size: 25px;
  font-weight: bold;
  margin-right: 20px;
  width: 889px;
   word-break:break-all;
}

#policyDiv .policyMsg {
  font-size: 12px;
  color: #999999;
  margin-bottom: 20px;
}

#policyDiv .policyMsgTable {
  width: 1200px;
  border: 1px solid #e1e1e1;
  font-size: 15px;
  color: #666666;
}

#policyDiv .policyMsgTable .policyMsgRow {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e1e1e1;
}

#policyDiv .policyMsgTable .policyMsgRow .policyMsgCellTitle {
  padding: 15px 0;
  width: 100px;
  text-align: center;
  background-color: #f4f4f4;
}

#policyDiv .policyMsgTable .policyMsgRow .policyMsgCell {
  padding: 15px 20px;
  text-align: left;
  width: 500px;
  word-wrap: break-word;
  word-break: normal;
}

.policyBtnDiv {
  width: 1200px;
  text-align: right;
  margin: 30px 0;
  display: flex;
  justify-content: right;
  line-height: 40px;
}

.policyBtnDiv .policyCantSendBtn {
  display: inline-block;
  background-color: #f1f2f4;
  color: #999999;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 15px;
}

.policyBtnDiv .policyCantSendBtn:hover {
  cursor: pointer;
}

.policyBtnDiv .policySendBtn {
  display: inline-block;
  background-color: #045db9;
  color: #f1f2f4;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 15px;
  transition: all 0.2s ease 0s;
}

.policyBtnDiv .policySendBtn:hover {
  cursor: pointer;
}

#selectTypeDiv {
  width: 1200px;
  display: flex;
  border-bottom: 3px solid #d00000;
  padding: 0 20px;
  margin-bottom: 30px;
}

#selectTypeDiv div {
  padding: 5px 20px;
  font-weight: bold;
}

#selectTypeDiv .selectType {
  background-color: #d00000;
  color: #ffffff;
  margin-bottom: -1px;
}

#selectTypeDiv .btn:hover {
  background-color: #d00000;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease 0s;
  margin-bottom: -1px;
}

.policyDetailsDiv {
}

.policyDetailsDiv .policyDetailDiv {
  border: 1px solid #eeeeee;
  padding: 20px;
  margin-bottom: 20px;
}

.policyDetailsDiv .policyDetailDiv .policyTitleDiv {
  font-weight: bold;
  color: #045db9;
  font-size: 20px;
}

.policyDetailsDiv .policyDetailDiv .policyDescription {
  padding: 30px;
  font-size: 14px;
  white-space: pre-line;
  word-break:break-all;
}

.policyDetailsDiv .policyDetailDiv .policyDescription div {
  line-height: 200%;
}

.policyDetailsDiv .policyDetailDiv .policyDescription span {
  line-height: 200%;
}
.policyDetailsDiv .policyDetailDiv .policyDescriptiona {
  word-wrap: break-word;
  word-break: normal;
}
.policyDetailsDiv .policyDetailDiv .policyExplain {
  padding: 20px 0px;
}

.policyDetailsDiv .policyDetailDiv .policyExplainTitle {
  font-weight: bold;
  word-wrap: break-word;
  font-size: 16px;
}

.policyDetailsDiv .policyDetailDiv .policyExplainContent {
  line-height: 25px;
    word-wrap: break-word;

  font-size: 15px;
  margin: 20px 0;
}

.policyDetailsDiv .policyDetailDiv .policyExplainMsg {
  display: flex;
    word-wrap: break-word;

  justify-content: space-between;
  font-size: 15px;
  color: #999999;
}

.policyDetailsDiv .policyDetailDiv .accessorieDiv {
  margin: 10px 0;
}

.policyDetailsDiv .policyDetailDiv .accessorieDiv .accessorieFileName {
  color: #d00000;
  transition: all 0.2s ease 0s;
}

.policyDetailsDiv .policyDetailDiv .accessorieDiv .accessorieFileName:hover {
  cursor: pointer;
  text-decoration: underline;
}

.policyDetailsDiv .policyDetailDiv .showingNum {
  font-weight: bold;
}

.layout {
  min-height: 100vh;
  position: relative;
  padding-bottom: 150px;
  box-sizing: border-box;
}

.btn-bottom {
  text-align: center;
  margin: 40px 0 150px;
}
.btn-bottom .cancelBtn {
  display: inline-block;
  font-size: 14px;
  background-color: #f1f2f4;
  color: #045db9;
  padding: 10px 46px;
  text-align: center;
  border-radius: 5px;
  margin-right: 10px;
}
.btn-bottom .cancelBtn:hover {
  cursor: pointer;
  box-shadow: 0px 0px 5px #eeeeee;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}
::v-deep p img {
  width: 100%;
}
</style>
